package com.wing.sales.controller;


import com.wing.common.utils.JsonResult;
import com.wing.sales.entity.request.SalesCreateRequest;
import com.wing.sales.service.SalesService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * 畅捷通-材料出库-领料出库
 */
@Validated
@Api(value = "畅捷通-销售出库管理", tags = "#/chanjet/sales")
@RestController("SalesController")
@RequestMapping("sales/admin/sales")
@RequiredArgsConstructor
public class SalesController {

    @Resource
    SalesService purchaseService;

    /**
     * 创建销售出库单
     */
    @ApiOperation(value = "创建销售出库单", notes = "保存")
    @PostMapping("/syncOutSalesDispatch")
    public JsonResult syncOutSalesDispatch(@RequestBody SalesCreateRequest salesCreateRequest) {
        return JsonResult.success(purchaseService.syncOutSalesDispatch(salesCreateRequest));
    }



}
